package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.SurveyCompetitorsEntity;
import com.ly.heart.mapper.SurveyCompetitorsMapper;
import com.ly.heart.service.ISurveyCompetitorsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 勘测后竞争对手管理Service业务层处理
 *
 * @author wutao
 * @date 2024-05-22
 */
@Service
public class SurveyCompetitorsServiceImpl extends ServiceImpl<SurveyCompetitorsMapper, SurveyCompetitorsEntity> implements ISurveyCompetitorsService {

    @Resource
    private SurveyCompetitorsMapper erpSurveyCompetitorsInfoMapper;

    /**
     * 查询勘测后竞争对手管理
     *
     * @param id 勘测后竞争对手管理ID
     * @return 勘测后竞争对手管理
     */
    @Override
    public SurveyCompetitorsEntity selectErpSurveyCompetitorsInfoById ( String id ) {
        return erpSurveyCompetitorsInfoMapper.selectErpSurveyCompetitorsInfoById ( id );
    }

    /**
     * 查询勘测后竞争对手管理列表
     *
     * @param erpSurveyCompetitorsInfo 勘测后竞争对手管理
     * @return 勘测后竞争对手管理
     */
    @Override
    public List<SurveyCompetitorsEntity> selectErpSurveyCompetitorsInfoList ( SurveyCompetitorsEntity erpSurveyCompetitorsInfo ) {
        return erpSurveyCompetitorsInfoMapper.selectErpSurveyCompetitorsInfoList ( erpSurveyCompetitorsInfo );
    }

    /**
     * 新增勘测后竞争对手管理
     *
     * @param erpSurveyCompetitorsInfo 勘测后竞争对手管理
     * @return 结果
     */
    @Override
    public int insertErpSurveyCompetitorsInfo ( SurveyCompetitorsEntity erpSurveyCompetitorsInfo ) {
        erpSurveyCompetitorsInfo.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        erpSurveyCompetitorsInfo.setCreateTime ( DateUtils.getNowDate () );
        return erpSurveyCompetitorsInfoMapper.insertErpSurveyCompetitorsInfo ( erpSurveyCompetitorsInfo );
    }

    /**
     * 修改勘测后竞争对手管理
     *
     * @param erpSurveyCompetitorsInfo 勘测后竞争对手管理
     * @return 结果
     */
    @Override
    public int updateErpSurveyCompetitorsInfo ( SurveyCompetitorsEntity erpSurveyCompetitorsInfo ) {
        return erpSurveyCompetitorsInfoMapper.updateErpSurveyCompetitorsInfo ( erpSurveyCompetitorsInfo );
    }

    /**
     * 批量删除勘测后竞争对手管理
     *
     * @param ids 需要删除的勘测后竞争对手管理ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyCompetitorsInfoByIds ( String[] ids ) {
        return erpSurveyCompetitorsInfoMapper.deleteErpSurveyCompetitorsInfoByIds ( ids );
    }

    /**
     * 删除勘测后竞争对手管理信息
     *
     * @param id 勘测后竞争对手管理ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyCompetitorsInfoById ( String id ) {
        return erpSurveyCompetitorsInfoMapper.deleteErpSurveyCompetitorsInfoById ( id );
    }
}
